<template>
	<view class="container">
		<!-- <uni-list>
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'person-filled'}" title="昵称" :rightText="user.nickName" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'phone-filled'}" title="手机号码" :rightText="user.phonenumber" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'email-filled'}" title="邮箱" :rightText="user.email" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'auth-filled'}" title="岗位" :rightText="postGroup" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'staff-filled'}" title="角色" :rightText="roleGroup" />
      <uni-list-item showExtraIcon="true" :extraIcon="{type: 'calendar-filled'}" title="创建日期" :rightText="user.createTime" />
    </uni-list> -->

		<view class="content-section">
			<view class="menu-list">
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view>
							<u-icon name="account-fill">
							</u-icon>
							用户昵称
						</view>
						<view class="text-right">{{user.nickName}}</view>
					</view>
				</view>
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view><u-icon name="phone-fill"></u-icon>手机号码</view>
						<view class="text-right">{{user.phonenumber}}</view>
					</view>
				</view>
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view>
							<u-icon name="email-fill"></u-icon>
							邮箱
						</view>
						<view class="text-right">{{user.email}}</view>
					</view>
				</view>
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view><u-icon name="server-man"></u-icon>岗位</view>
						<view class="text-right">{{postGroup}}</view>
					</view>
				</view>
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view><u-icon name="fingerprint"></u-icon>角色</view>
						<view class="text-right">
							{{roleGroup}}
						</view>
					</view>
				</view>
				<view class="list-cell list-cell-arrow">
					<view class="menu-item-box">
						<view><u-icon name="calendar-fill"></u-icon>注册日期</view>
						<view class="text-right">
							{{user.createTime}}
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getUserProfile
	} from "@/api/system/user"

	export default {
		data() {
			return {
				user: {},
				roleGroup: "",
				postGroup: ""
			}
		},
		onLoad() {
			this.getUser()
		},
		methods: {
			getUser() {
				getUserProfile().then(response => {
					this.user = response.data
					this.roleGroup = response.roleGroup
					this.postGroup = response.postGroup
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #ffffff;
	}
</style>